<script setup>
const props = defineProps({
	menu: {
		type: Array,
		default: () => [],
	},
})
</script>

<template>
	<template v-for="item in props.menu" :key="item.path">
		<template v-if="item.show">
			<el-sub-menu
				v-if="item.children && item.children?.length > 0"
				:key="item.path"
				:index="item.path"
			>
				<template #title>
					<span>{{ item.title }}</span>
				</template>
				<sub-menu v-if="item.children" :menu="item.children" />
			</el-sub-menu>
			<el-menu-item v-else :key="item.path" :index="item.path">
				{{ item.title }}
			</el-menu-item>
		</template>
	</template>
</template>
